package com.android.googlesettings.util;

import com.android.googlesettings.BaseApplication;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class SharedPreferencesUtil {
	
	public static String VERIFY_LENGTH = "verify_days";
	public static String OPEN_NOTIFICATION ="open_notification";
	public static String FIRST_IN_FLAG = "first_in";
	public static String RECORD_FLAG = "record_flag";

	static SharedPreferences spSet = BaseApplication.getInstance().getSharedPreferences("setting", Context.MODE_PRIVATE);

	public static void putInt(String key, int value) {
		Editor editor = spSet.edit();
		editor.putInt(key, value);
		editor.commit();
	}

	public static void putString(String key, String value) {
		Editor editor = spSet.edit();
		editor.putString(key, value);
		editor.commit();
	}

	public static void putBoolean(String key, boolean value) {
		Editor editor = spSet.edit();
		editor.putBoolean(key, value);
		editor.commit();
	}

	public static int getInt(String key, int defValue) {
		return spSet.getInt(key, defValue);
	}

	public static boolean getBoolean(String key, boolean defValue) {
		return spSet.getBoolean(key, defValue);
	}

	public static String getString(String key, String defValue) {
		return spSet.getString(key, defValue);
	}
}
